<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>新客户登记 - 物流管理系统</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<style media="all" type="text/css">@import "../../style/all.css";</style>
	<script type="text/javascript" src="../../js/jquery-1.8.3.js"></script>
	<script type="text/javascript" language="javascript">
	$(function(){
		$("#update").click(function(){
		  var customerid = $("#customerid").val();
		  var customername = $("#customername").val();				
		  var idcard = $("#idcard").val();
		  var workplace = $("#workplace").val();
		  var phone = $("#phone").val();
		  var mobile = $("#mobile").val();
		  var address = $("#address").val();
		  var customerzipcode = $("#customerzipcode").val();
		  var email = $("#email").val();
		  var customerArea = $("#customerArea").val();
		  if(window.confirm("确认修改吗？")){								
		   $.ajax({
			   type:"put", 
			   url:"../../customer/updateLcustomerById",
			   contentType:"application/json",					
			   data:JSON.stringify({"customerid": customerid,"customername": customername,"idcard": idcard,"workplace":workplace,"phone": phone,"mobile":mobile,"address":address,"customerzipcode":customerzipcode,"email":email,"customerArea":customerArea}),
			   success:function(result){
				   alert(result);				   
				   window.location.href='../../customer/getAllcustomer';
				   }
		   });		   
		};
	});	
	
})
	</script>
</head>
<body style="background: none">
	<div class="top-bar">
		<h1>修改客户信息</h1>
		<div class="breadcrumbs">
			<a href="../../index.jsp" target="_top">首页</a> /
			<a href="../index.jsp" target="_top">客户服务中心</a>
		</div>
	</div>
	<div class="table">
		<img src="../../style/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
		<img src="../../style/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
		<table class="listing form" cellpadding="0" cellspacing="0">		
			<tr>
				<th class="full" colspan="4">修改客户信息</th>
			</tr>
			<tr>
				<td class="first">客户编号</td>
				<td><input type="text" id="customerid" value="${cus.customerid}" readonly="readonly" style="border:none;background-color: #d8d8d8;width:100%;text-align: center;" /></td>
				<td>客户姓名</td>
				<td class="last"><input type="text" class="text" id="customername" value="${cus.customername}"/></td>
			</tr>
			<tr>
				<td class="first">身份证编号</td>
				<td><input type="text" class="text" id="idcard" value="${cus.idcard}"/></td>
				<td>工作单位</td>
				<td class="last"><input type="text" id="workplace" class="text" value="${cus.workplace}"/></td>
			</tr>
			<tr class="bg">
				<td class="first">座机</td>
				<td><input type="text" class="text" id="phone" value="${cus.phone}"/></td>
				<td>移动电话</td>
				<td class="last"><input type="text" id="mobile" class="text" value="${cus.mobile}"/></td>
			</tr>
			<tr>
				<td class="first">联系地址</td>
				<td><input type="text" class="text" id="address" value="${cus.address}"/></td>
				<td>邮编</td>
				<td class="last"><input type="text" id="customerzipcode" class="text" value="${cus.customerzipcode}"/></td>
			</tr>
			<tr>
				<td class="first">E-mail</td>
				<td><input type="text" class="text" id="email" value="${cus.email}"/></td>
				<td>区域</td>
				<td class="last"><input type="text" id="customerArea" class="text" value="${cus.customerArea}"/></td>
			</tr>
		</table>
		<div align="center" style="width:100%;">
			<input type="button" class="button" onclick="javascript:window.history.go(-1);" value=" 返 回 "/>&nbsp;
			<input type="button" class="button" id="update" value=" 修 改 "/>			
		</div>
	</div>
</body>
</html>
